package com.x.erp.service;

import java.util.List;

import com.x.erp.model.CarLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.x.erp.dao.CarDelDao;
import com.x.erp.manage.CarDelManage;
import com.x.erp.model.CarDel;
import com.x.erp.rpc.CarDelRpcService;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;

@Component
@Service(interfaceName = "com.x.erp.rpc.CarDelRpcService", timeout = 60000)
public class CarDelService extends BaseService implements CarDelRpcService {

	@Autowired
	private CarDelDao carDelDao;//车辆DAO
	@Autowired
	private CarDelManage carDelManage;

	/**
	 * 插入车辆删除信息
	 * @param carDel
	 * @return
	 */
	@Override
	public CarDel insertCarDel(CarDel carDel, CarLog carLog) {
		try {
			return carDelManage.insertCarDel(carDel, carLog);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}
	

	/**
	 * 查询删除车辆列表
	 * @param carDel
	 * @return
	 */
	@Override
	public List<CarDel> selectCarDelList(CarDel carDel) {
		try {
			return carDelDao.selectCarDelList(carDel);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	/**
	 * 查询删除车辆
	 * @param carDel
	 * @return
	 */
	@Override
	public CarDel selectCarDel(CarDel carDel) {
		try {
			return carDelDao.selectCarDel(carDel);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

}
